
#pragma once

#include "Application.h"
#include "Account.h"



class CPropertiesToolBar : public CMFCToolBar
{
public:
	virtual void OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL bDisableIfNoHndler)
	{
		CMFCToolBar::OnUpdateCmdUI((CFrameWnd*) GetOwner(), bDisableIfNoHndler);
	}

	virtual BOOL AllowShowOnList() const { return FALSE; }
};

class CPropertiesWnd : public CDockablePane
{
// Construction
public:
	CPropertiesWnd();

	void AdjustLayout();

// Attributes
private:

	CApplication* m_application;
	CAccount* m_account;

	CMFCPropertyGridProperty* pApplicationGroup;
	CMFCPropertyGridProperty* pAppliName;
	CMFCPropertyGridProperty* pAppliVersion;
	CMFCPropertyGridProperty* pAppliDescription;
	CMFCPropertyGridProperty* pAppliComment;
	CMFCPropertyGridProperty* pAppliEnabled;
	CMFCPropertyGridProperty* pAppliId;

	CMFCPropertyGridProperty* pAccountGroup;
	CMFCPropertyGridProperty* pAccountLogin;
	CMFCPropertyGridProperty* pAccountPassword;
	CMFCPropertyGridProperty* pAccountThirdField;
	CMFCPropertyGridProperty* pAccountFourthField;
	CMFCPropertyGridProperty* pAccountEnabled;
	CMFCPropertyGridProperty* pAccountId;
	CMFCPropertyGridProperty* pAccountOldPasswordGroup;
	CMFCPropertyGridProperty* pAccountOldPassword1;
	CMFCPropertyGridProperty* pAccountOldPassword2;
	CMFCPropertyGridProperty* pAccountOldPassword3;
	CMFCPropertyGridProperty* pAccountOldPassword4;
	CMFCPropertyGridProperty* pAccountOldPassword5;
	CMFCPropertyGridProperty* pAccountOldPassword6;

	CMFCPropertyGridProperty* pStateGroup;
	CMFCPropertyGridProperty* pTechnicalGroup;

public:
	void SetVSDotNetLook(BOOL bSet)
	{
		m_wndPropList.SetVSDotNetLook(bSet);
		m_wndPropList.SetGroupNameFullWidth(bSet);
	}

protected:
	CFont m_fntPropList;
	CComboBox m_wndObjectCombo;
	CMFCPropertyGridCtrl m_wndPropList;

// Implementation
public:
	virtual ~CPropertiesWnd();

protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnExpandAllProperties();
	afx_msg void OnUpdateExpandAllProperties(CCmdUI* pCmdUI);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);

	DECLARE_MESSAGE_MAP()

	void InitPropList();
	void SetPropListFont();
public:
	void SetApplication(const CApplication& nApp);
	void SetAccount(const CAccount& nAcc);
	void SetApplicationPropertyGridVisible(BOOL bvisible);
	void SetAccountPropertyGridVisible(BOOL bvisible);
};

